﻿// Copyright (c) Yoganand R. All rights reserved.
// For continued development and updates, visit http://yogsbreath.com
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections.Generic;
using System.ComponentModel;

namespace MVCnExt.Web.UI.Ext
{
    public abstract class ExtConfig : IScriptControl
    {        
     
        #region IScriptControl Members

        /// <summary>
        /// Register the key/value pairs which will be used to render the client-side
        /// object as script.
        /// </summary>
        /// <returns>A list of key/value pairs which comprise the client-side properties
        /// of this control</returns>
        public virtual IList<ScriptDescriptor> GetScriptDescriptors()
        {
            List<ScriptDescriptor> descriptors = new List<ScriptDescriptor>();            

            return descriptors;
        }

        /// <summary>
        /// Register external script references to be added to the page
        /// </summary>
        /// <returns>A list of external scripts upon which this control (or its children)
        /// are dependent.</returns>
        public virtual List<ScriptReference> GetScriptReferences()
        {
            List<ScriptReference> references = new List<ScriptReference>();            
            return references;
        }

        IEnumerable<ScriptReference> IScriptControl.GetScriptReferences()
        {
            return this.GetScriptReferences();
        }

        IEnumerable<ScriptDescriptor> IScriptControl.GetScriptDescriptors()
        {
            return this.GetScriptDescriptors();
        }
        #endregion

        #region Public Properties

        /// <summary>
        /// Identifier value.
        /// </summary>
        [Description("Identifier value.")]
        public virtual String id { get; set; }

        #endregion
    }
}
